<?php
namespace App\Api\Transformers;


use App\ClubVideos;
use League\Fractal\TransformerAbstract;

class ClubVideoTransformer extends TransformerAbstract
{
    /**
     * @param ClubVideo $clubVideo
     * @return array
     */
    public function transform(ClubVideos $clubVideo)
    {
        $videoUrl = "http://yuejian.app/uploads/videos/";
        $picUrl = "http://yuejian.app/uploads/clubs_video/videos/";
        return [
            'cvideo_id' => $clubVideo['id'],
            'club_id' => $clubVideo['club_id'],
            'cvideo_name' => $clubVideo['cvideo_name'],
            'cvideo_pic' => $picUrl.$clubVideo['cvideo_pic'],
            'cvideo' => $videoUrl.$clubVideo['cvideo_address'],
        ];
    }
}